/*
 * @Author: Jimmy
 * @LastModifiedBy: Jimmy
 * @Date: 2024-04-14 21:08:58
 * @LastEditTime: 2024-06-29 19:38:29
 * @FilePath: /nest_study/web/src/views/system/post/columns.tsx
 */
import { Button, Flex } from "antd";
import { formateLocalDateTime } from "@/utils";

export const columns = (edit: Function, remove: Function) => [
    {
        title: '职位编码',
        dataIndex: 'code',
        ellipsis: true
    },
    {
        title: '职位名称',
        dataIndex: 'name',
        ellipsis: true
    },
    {
        title: '排序',
        dataIndex: 'sort',
        ellipsis: true
    },
    // {
    //     title: '状态',
    //     dataIndex: 'status',
    //     ellipsis: true
    // },
    {
        title: '备注',
        dataIndex: 'remark',
    },
    {
        title: '创建时间',
        dataIndex: 'createTime',
        width: 165,
        render: (text: any, _row: any, _index: number) => <p>{formateLocalDateTime(text)}</p>,
    },
    {
        title: '操作',
        dataIndex: 'action',
        width: 120,
        align: "center" as "center",
        fixed: 'right' as 'right',
        render: (_text: any, _row: any, _index: number) => <Flex gap={10} align="center">
            <Button size="small" type="primary" onClick={() => edit(_row)}>编辑</Button>
            <Button size="small" type="primary" onClick={() => remove(_row)} danger>删除</Button>
        </Flex>,
    }
]